package com.bw.park.ui.splash

import android.content.Intent
import com.bw.park.R
import com.bw.park.databinding.ActivitySplashBinding
import com.bw.park.ui.login.LoginActivity
import com.mooc.lib_common.action.BusConst
import com.mooc.lib_common.mvvm.BaseActivity

class SplashActivity:BaseActivity<SplashViewModel,ActivitySplashBinding>() {

    override fun initView() {
    }

    override fun bindLayout(): Int {
        return R.layout.activity_splash
    }

    override fun initData() {
        vm.startPagerData.observe(this,{
            if (it.action.equals(BusConst.LOGINACTION)){
                //定时完成，用户信息获取切换界面判断
                startActivity(Intent(SplashActivity@this,LoginActivity::class.java))
                finish()
            }
        })
        vm.startTimmer()
    }
}